﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace DigitalTVWS
{
    // NOTE: If you change the interface name "IServiceCompra" here, you must also update the reference to "IServiceCompra" in Web.config.
    [ServiceContract]
    public interface IServiceCompra
    {

        [OperationContract]
        bool inserir(CompositeCompra compra);

        [OperationContract]
        bool remover(int idCompra);

        [OperationContract]
        List<CompositeCompra> ConsultarPorCliente(string cliente);

    }

    [DataContract]
    public class CompositeCompra
    {
        private int id_Compra;
        [DataMember]
        public int Id_Compra
        {
            get { return id_Compra; }
            set { id_Compra = value; }
        }

        private string cliente;
        [DataMember]
        public string Cliente
        {
            get { return cliente; }
            set { cliente = value; }
        }

        private int programacao;
        [DataMember]
        public int Programacao
        {
            get { return programacao; }
            set { programacao = value; }
        }

        private double preco;
        [DataMember]
        public double Preco
        {
            get { return preco; }
            set { preco = value; }
        }

        private DateTime dataCompra;
        [DataMember]
        public DateTime Data
        {
            get { return dataCompra; }
            set { dataCompra = value; }
        }
    }

    [DataContract]
    public class CompositeComponente
    {
        private int id;
        [DataMember]
        public int Id
        {
            get { return id; }
            set { id = value; }
        }

        private string nome;
        [DataMember]
        public string Nome
        {
            get { return nome; }
            set { nome = value; }
        }

    }
}
